package cz.muni.fi.pa165.library.api;

import java.io.Serializable;

/**
 *
 * @author Zuzana Foltýnová
 */
public class BookTO implements Serializable {

    private static final long serialVersionUID = 2L;
    private Long id;
    private String title;
    private String author;
    private Genre genre;
    private String publicationYear;
    private String publicationPlace;
    private String publisher;
    private String ISBN;
    private State status;
    private Available availability;

    public BookTO() {
    }

    public BookTO(String title, String author, Genre genre, String publicationYear, String publicationPlace, String publisher, String ISBN, State status, Available availability) {
        this.title = title;
        this.author = author;
        this.genre = genre;
        this.publicationYear = publicationYear;
        this.publicationPlace = publicationPlace;
        this.publisher = publisher;
        this.ISBN = ISBN;
        this.status = status;
        this.availability = availability;
    }

    public Long getId() {
        return id;
    }

    public String getTitle() {
        return title;
    }

    public String getAuthor() {
        return author;
    }

    public Genre getGenre() {
        return genre;
    }

    public String getPublicationYear() {
        return publicationYear;
    }

    public String getPublicationPlace() {
        return publicationPlace;
    }

    public String getPublisher() {
        return publisher;
    }

    public String getISBN() {
        return ISBN;
    }

    public State getStatus() {
        return status;
    }

    public Available getAvailability() {
        return availability;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public void setGenre(Genre genre) {
        this.genre = genre;
    }

    public void setPublicationYear(String publicationYear) {
        this.publicationYear = publicationYear;
    }

    public void setPublicationPlace(String publicationPlace) {
        this.publicationPlace = publicationPlace;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    public void setISBN(String ISBN) {
        this.ISBN = ISBN;
    }

    public void setStatus(State status) {
        this.status = status;
    }

    public void setAvailability(Available availability) {
        this.availability = availability;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof BookTO)) {
            return false;
        }
        BookTO other = (BookTO) obj;
        if ((this.id == null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "author: " + author + ", title: " + title;
    }
}
